package cn.chia.utils;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.OutputStream;
//生成.txt日志文件公共代码
public class BuildLogFile {
	public static void build(String info){
		//info = info +"\r\n";
		File file = new File("C:"+File.separator+"log_chia.txt");
		if(!file.getParentFile().exists()){
			file.getParentFile().mkdirs();
		}
		byte[] data = info.getBytes();
		OutputStream output;
		try {
			output = new FileOutputStream(file,true);
			for(int i=0;i<data.length;i++){
				output.write(data[i]);
			}
			output.close();
		} catch (Exception e) {
			e.printStackTrace();
		}
		
	}
}
